﻿using System.ComponentModel;
using System.Net;

namespace NetMicro.Trace.Email
{
    public class EmailConnectionInfo
    {
        /// <summary>
        /// 多少时间发送一次异常邮件时间单位秒
        /// </summary>
        [DefaultValue(30)]
        public int Period { get; set; }
        /// <summary>
        /// 设置用于身份验证的凭据
        /// </summary>
        public ICredentialsByHost NetworkCredentials { get; set; }

        /// <summary>
        /// 设置用于连接的端口
        /// </summary>
        [DefaultValue(25)]
        public int Port { get; set; }

        /// <summary>
        /// 发送者地址
        /// </summary>
        public string FromEmail { get; set; }

        /// <summary>
        /// 接收者地址
        /// </summary>
        public string ToEmail { get; set; }

        /// <summary>
        /// 发送主题
        /// </summary>
        [DefaultValue("日志信息")]
        public string EmailSubject { get; set; }

        /// <summary>
        /// SMTP客户端是否使用SSL
        /// </summary>
        public bool EnableSsl { get; set; }

        /// <summary>
        /// 提供一种验证服务器证书的方法
        /// </summary>
        public System.Net.Security.RemoteCertificateValidationCallback ServerCertificateValidationCallback { get; set; }

        /// <summary>
        /// SMTP电子邮件服务器
        /// </summary>
        public string MailServer { get; set; }

        /// <summary>
        /// 设置电子邮件的正文内容是否为HTML，默认为false
        /// </summary>
        [DefaultValue(false)]
        public bool IsBodyHtml { get; set; }
    }
}
